const express = require("express");
// 导入操作数据库的实例
const db = require("../db/mysql");
// 生成路由实例
const router = express.Router();

router.get("/hello", function (req, res) {
  console.log("router one!");
  let result = null;
  const SQL = "select * from poetry limit 10";
  db.query(SQL, (err, res) => {
    result = res;
    console.log(result);
  });
  res.end("hello world!");
});

// 暴露路由实例
module.exports = router;
